#include <iostream>
using namespace std;

class Solution {
public:
    int hammingDistance(int x, int y) {
        int tmp = x ^ y, cnt = 0;
        //数有多少个1不就可以了？
        while(tmp){
            tmp &= (tmp - 1);
            ++cnt;
        }
        return cnt;
    }
};